package com.hamster.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hamster.crm.pojo.EmployeeScore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * 员工评分记录表
 * @author Tarry
 * @create 2019/12/21 16:03
 */
@Mapper
@Repository
public interface EmployeeScoreMapper extends BaseMapper<EmployeeScore> {
    /**
     * 只查询最新的一条数据
     * @param id
     * @return
     */
    @Select("select * from employee_score where employee_id = #{id} group by score_time desc limit 1")
    EmployeeScore selectFirst(@Param("id") String id);
}
